/*Copyright (C) 2013-2021 LZE*/
#include<bits/stdc++.h>
#define fo(x) freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);
#define INF 0x7fffffff
#define mod 1000000007
#define eps 1e-6
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const int N = 1000010;
const int M = 100010;
ll n,m;
ll a[N],v[N];
int main() {
	scanf("%lld",&n);
    for(ll i = 1;i <= n;i++){
        scanf("%lld",&a[i]);
        v[i] = a[i];
    }
    sort(a + 1,a + 1 + n);
    ll new_n = unique(a + 1,a + 1 + n) - a - 1;
    for(ll i = 1;i <= n;i++){
        printf("%lld ",ll(lower_bound(a + 1,a + 1 + new_n,v[i]) - a));
    }
	return 0;
}
